package com.example.ycdyus.dailyfruit.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.example.ycdyus.dailyfruit.R;
import com.example.ycdyus.dailyfruit.bean.Banner;
import com.example.ycdyus.dailyfruit.utils.ImageLoaderHelper;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;

import java.util.List;

/**
 * Created by ycdyus on 2015/10/18.
 */
public class HomeListViewAdapter extends CommonAdapter<Banner>{
    private DisplayImageOptions options;
    public HomeListViewAdapter(Context context, List<Banner> mDatas, int itemLayoutId) {
        super(context, mDatas, itemLayoutId);
        options = ImageLoaderHelper.getDisplayImageLoader();
    }

    @Override
    public void convert(ViewHolders holder, Banner item) {
        ImageLoader.getInstance().displayImage(item.getPhoto(),(ImageView) holder.getView(R.id.iv_item_home_listview),options);
    }
}
